<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	template="/users/users-frame.xhtml">
	
	<ui:param name="pageTitle" value="#{messages['page.users.changepassword.title']}" />

	<ui:define name="subheader">#{identity.getPrincipal().getName()} - #{messages['page.users.changepassword.subheader']}</ui:define>

	<ui:define name="main">
		<h:form id="userEditForm">
			<rich:panel id="userEditPanel">
				<f:facet name="header">
					<h:outputText value="#{messages['page.users.changepassword.panel.title']} #{identity.getPrincipal().getName()}" />
				</f:facet>

				<s:decorate id="userOldPasswordDecoration"
					template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['user.password.old']}:</ui:define>
					<h:inputSecret value="#{oldPassword}" required="true"
						id="oldpassword" style="width:300px;"
                        validatorMessage="#{messages['validator.password']}">
                        <f:validateLength minimum="6"/>
                    </h:inputSecret>
				</s:decorate>

				<s:decorate id="userNewPasswordDecoration"
					template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['user.password.new']}:</ui:define>
					<h:inputSecret value="#{newPassword}" required="true"
						id="newpassword" style="width:300px;"
                        validatorMessage="#{messages['validator.password']}">
                        <f:validateLength minimum="6"/>
                    </h:inputSecret>
				</s:decorate>

				<s:decorate id="userConfirmDecoration" template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['user.password.new.confirm']}:</ui:define>
					<h:inputSecret value="#{confirm}" required="true" id="cofirm"
						style="width:300px;"
                        validatorMessage="#{messages['validator.password']}">
                        <f:validateLength minimum="6"/>
                    </h:inputSecret>
				</s:decorate>

				<s:decorate template="/layout/buttonbox.xhtml" id="personButtonBox">
					<h:commandButton action="#{passwordBean.change()}"
						value="#{messages['general.save']}" id="save" />
					<s:button outcome="back" value="#{messages['general.back']}"
						view="/users/index.xhtml" id="back" />
				</s:decorate>
			</rich:panel>
		</h:form>
	</ui:define>
</ui:composition>
